package cn.com.egova.demoapplication;

import android.graphics.Color;
import android.os.Bundle;
import android.support.v4.app.Fragment;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import android.widget.LinearLayout;
import android.widget.TextView;

/**
 * Created by yuanchao on 2017/3/9.
 */

public class TestFragment extends Fragment {

    public static TestFragment newInstance(String title) {
        TestFragment newFragment = new TestFragment();
        Bundle bundle = new Bundle();
        bundle.putString("title",title);
        newFragment.setArguments(bundle);
        return newFragment;
    }

    @Override
    public View onCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) {
        ViewGroup.LayoutParams params = new LinearLayout.LayoutParams(ViewGroup.LayoutParams.MATCH_PARENT, ViewGroup.LayoutParams.MATCH_PARENT);
        TextView tv = new TextView(getContext());
        tv.setTextSize(25);
        tv.setTextColor(Color.RED);
        tv.setText(getArguments().getString("title"));
//        container.addView(tv);
        return tv;
    }
}
